/******************************************************************************
 * SAGE - Scalable Adaptive Graphics Environment
 *
 * Module: sageDraw.h
 * Author : Byungil Jeong
 *
 *	Description: This is the header file for the simple drawing class of SAGE. 
 *
 * Copyright (C) 2007 Electronic Visualization Laboratory,
 * University of Illinois at Chicago
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either Version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License along
 * with this library; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * Direct questions, comments etc about SAGE to bijeong@evl.uic.edu or 
 * http://www.evl.uic.edu/cavern/forum/
 *			
*********************************************************************************/

#ifndef SAGE_DRAW_H
#define SAGE_DRAW_H

#if defined(__APPLE__)
#include <ApplicationServices/ApplicationServices.h>
#include <AGL/agl.h>
#include <OpenGL/OpenGL.h>

#else

#include <SDL/SDL.h>

#endif

#include "sage.h"
#include "sageDrawObject.h"

#if defined(__APPLE__)
#include <OpenGL/gl.h>	// Header File For The OpenGL Library
#include <OpenGL/glu.h>	// Header File For The GLu Library
#else
#include <GL/gl.h>	// Header File For The OpenGL Library
#include <GL/glu.h>	// Header File For The GLu Library
#endif

#define SAGE_POST_DRAW  0
#define SAGE_INTER_DRAW 1
#define SAGE_PRE_DRAW   2

class sageDraw {
private:
	std::vector<sageDrawObject *> preDrawList;
	std::vector<sageDrawObject *> postDrawList;
	
public:
	sageDraw();
	int init();	
	sageDrawObject * createDrawObject(char *name);
	int preDraw(sageRect rect);  // draw objects to background
	int postDraw(sageRect rect); // draw objects to overlay
	int addObjectInstance(char *data);
	int updateObjectPosition(char *data);
	int removeObject(int id);
	int forwardObjectMessage(char *data);
	~sageDraw();
};

#endif
